package cn.itcast.web.controller;

import cn.itcast.domain.company.Company;
import cn.itcast.service.company.CompanyService;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApplyController {
    @Reference
    private CompanyService companyService;
    @PostMapping("/apply")
    public String apply(Company company) {
        try {
            company.setState(0);
            companyService.save(company);
            return "1";
        }catch (Exception e){
            return "2";
        }
    }
}
